package com.omkarpatil.learningjpa2.mapping.onetoone.sharedpk.noid;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity(name = "OtoSharedPkNoIdProfile") 
@Table(name = "oto_sharedpk_noid_profile")
public class Profile implements Serializable {

	private String email;
	private User user;
	
	public Profile() {}
	
	public Profile(String email, User user) {
		this.email = email;
		this.user = user;
	}
	
	@Column(nullable = false, length = 30)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Id 
	@OneToOne
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}	
}
